package adavance.thread.bank;

/**
 * @author oldliu
 * @since 1.0
 */
public class AccTest {
    public static void main(String[] args) {
        Account ac=new Account("hf0001",4000);
        Taker t=new Taker("大牛",ac);
        Taker t1=new Taker("于军",ac);
        Taker t2=new Taker("王乐军",ac);
        Taker t3=new Taker("江传奇",ac);
        t.start();
        t1.start();
        t2.start();
        t3.start();

        try {
            t.join();
            t1.join();
            t2.join();
            t3.join();
            System.out.println("当前余额是："+ac.getMoney()+"元");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
